<?php
// +-------------------------------------------------------------------
// |
// +-------------------------------------------------------------------
// | Copyright (c) 2009-2016 All rights reserved.
// +-------------------------------------------------------------------
namespace Service\Api\V1;

class ServiceOrderCancel
{
    public $login = true; //是否需要登录才能访问该接口
    public $title = "预约取消ok";
    public $group = '物业服务';
    public $desc = "";

    public $input = [
        'id' => 'required;int;label=id;',
    ];

    public $output = [

    ];

    public function run($param, $uid)
    {
        $ret = M('service_order')
            ->where([
                'id' => $param['id'],
            ])
            ->save(['state' => 9]);
        if($ret){
            return true;
        }else{
            throw new \Exception('取消失败');
        }

    }
}
